-- GENERATED SPELL FOR [Cabal Summoner] --


function spell0_18634(pUnit, Event) --@Fireball,n/a--
pUnit:FullCastSpellOnTarget(14034,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_18634', 3000, 1)
end

function spell1_18634(pUnit, Event) --@Fireball,n/a--
pUnit:FullCastSpellOnTarget(15228,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_18634', 3000, 1)
end

function spell2_18634(pUnit, Event) --@Shadow Bolt,n/a--
pUnit:FullCastSpellOnTarget(33335,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_18634', 3000, 1)
end

function spell3_18634(pUnit, Event) --@Summon Cabal Acolyte,n/a--
if charge_disp ~= 'na' then
pUnit:FullCastSpellOnTarget(33507,pUnit:GetMainTank ())
local charge_disp = 'na'
end
pUnit:RegisterEvent('Sorts_18634', 1, 1)
end

function spell4_18634(pUnit, Event) --@Summon Cabal Deathsworn,n/a--
pUnit:FullCastSpellOnTarget(33506,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_18634', 4000, 1)
end

function Sorts_18634(pUnit, Event)
local choix_sorts_18634 = math.random(0, 4)
if choix_sorts_18634 == 0 then
pUnit:RegisterEvent('spell0_18634', 1, 1)
end
if choix_sorts_18634 == 1 then
pUnit:RegisterEvent('spell1_18634', 1, 1)
end
if choix_sorts_18634 == 2 then
pUnit:RegisterEvent('spell2_18634', 1, 1)
end
if choix_sorts_18634 == 3 then
pUnit:RegisterEvent('spell3_18634', 1, 1)
end
if choix_sorts_18634 == 4 then
pUnit:RegisterEvent('spell4_18634', 1, 1)
end
end

function mob18634_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_18634', math.random(1500, 3000), 1)
end

function mob18634_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob18634_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob18634_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(18634, 1, 'mob18634_Action')
RegisterUnitEvent(18634, 2, 'mob18634_Leave')
RegisterUnitEvent(18634, 3, 'mob18634_Kill')
RegisterUnitEvent(18634, 4, 'mob18634_Die')
